import { createRouter, createWebHistory } from 'vue-router'
import SdyHome from '@/views/SdyHome/index.vue'
import SdyCart from '@/views/SdyCart/index.vue'
import SdyCate from '@/views/SdyCategrod/index.vue'
import SdySelf from '@/views/SdySelf/index.vue'
import NotFound from '@/views/NotFound/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      redirect:'/home'
    },
    {
      path:'/home',
      name:'home',
     component:SdyHome
    },
    {
      path:'/cate',
      name:'cate',
     component:SdyCate
    },
    {
      path:'/cart',
      name:'cart',
     component:SdyCart
    },
    {
      path:'/self',
      name:'self',
     component:SdySelf
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/SdyLogin/index.vue'),
      meta: { hidFooter: true }
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('@/views/SdyRegister/index.vue'),
      meta: { hidFooter: true }
    },
    {
      path:'/search',
      name:'search',
     component:()=>import('@/views/SdySearch/index.vue'),
     meta:{hidFooter:true }
    },
    {
      path:'/list',
      name:'list',
     component:()=>import('@/views/SdyGoodsList/index.vue'),
     meta:{hidFooter:true }
    },
    {
      path:'/not-found',
      name:'not-found',
     component:NotFound,
     meta:{hidFooter:true }
    },
    {
      path:'/:pathMatch(.*)*',
      redirect:'not-found'
    },
   
  ]
})

export default router
